<?php

/**
 * operatorTour form.
 *
 * @package    travelbug
 * @subpackage form
 * @author     David J. Sloan
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class operatorTourForm extends BaseoperatorTourForm
{
  public function configure()
 
  { 
  	
  	$this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'user_id'          => new sfWidgetFormInputHidden(array('default'=>sfContext::getInstance()->getUser()->getGuardUser()->getId())),
      'tour_title'       => new sfWidgetFormInput(),
      'tour_description' => new sfWidgetFormInput(),
      'price'            => new sfWidgetFormInput(),
      'country'          => new sfWidgetFormInput(),
      'city'             => new sfWidgetFormInput(),
      'state'            => new sfWidgetFormInput(),
      'zip'              => new sfWidgetFormInput(),
      'keywords'         => new sfWidgetFormInput(),
      'tour_image'       => new sfWidgetFormInputFile(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'operatorTour', 'column' => 'id', 'required' => false)),
      'user_id'          => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'tour_title' => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'tour_description' => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'price'            => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'country'          => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'city'             => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'state'            => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'zip'              => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'keywords'         => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'tour_image'       => new sfValidatorString(array('max_length' => 200, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('operator_tour[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::configure();
  }
}
